package com.toonyoo.eurekaproducer;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
//@EnableEurekaClient
@EnableDiscoveryClient
@EnableHystrix
@EnableHystrixDashboard
@EnableCircuitBreaker
@Controller
@RefreshScope
public class EurekaProducerApplication {

	@Value("${testRefresh}")
	private String testRefresh;

	@Value("${hahahehe}")
	private String hahahehe;

    @Value("${darkVersion}")
	private String darkVersion;

	public static void main(String[] args) {
		SpringApplication.run(EurekaProducerApplication.class, args);
	}

	@RequestMapping(value = "/getTestRefresh")
	@ResponseBody
	public String getTestRefresh(){
		return testRefresh + " : " + hahahehe + " : " + darkVersion;
	}
}
